﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace AJWPFAdmin.Services.Migrations
{
    /// <inheritdoc />
    public partial class 设备表新增视频地址相关字段 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "VideoPlayBackRTSPUrl",
                table: "Devices",
                type: "longtext",
                nullable: true,
                comment: "RTSP视频回放地址")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "VideoPlayRTSPUrl",
                table: "Devices",
                type: "longtext",
                nullable: true,
                comment: "RTSP视频播放地址")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1000,
                column: "StringValue",
                value: "{\"url\":\"\",\"companyName\":\"\",\"dbServer\":null,\"dbUserId\":null,\"dbPassword\":null,\"dbName\":null,\"apiDomain\":null,\"apiToken\":null,\"queryTemplate\":null,\"closeClientAPI\":false}");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "VideoPlayBackRTSPUrl",
                table: "Devices");

            migrationBuilder.DropColumn(
                name: "VideoPlayRTSPUrl",
                table: "Devices");

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1000,
                column: "StringValue",
                value: "{\"url\":\"\",\"companyName\":\"\",\"dbServer\":null,\"dbUserId\":null,\"dbPassword\":null,\"dbName\":null,\"queryTemplate\":null,\"closeClientAPI\":false}");
        }
    }
}
